<!DOCTYPE html>
<html lang="zh-cmn-Hans">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <link rel="icon" href="<%= BASE_URL %>logo.png" />
    <title>基础管理框架</title>

    <style>
      .first-loading-wrp {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        min-height: 420px;
        height: 100%;
      }
      .first-loading-wrp > h1 {
        font-size: 128px;
      }
      .first-loading-wrp .loading-wrp {
        padding: 98px;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .dot {
        animation: antRotate 1.2s infinite linear;
        transform: rotate(45deg);
        position: relative;
        display: inline-block;
        font-size: 32px;
        width: 32px;
        height: 32px;
        box-sizing: border-box;
      }
      .dot i {
        width: 14px;
        height: 14px;
        position: absolute;
        display: block;
        background-color: #1890ff;
        border-radius: 100%;
        transform: scale(0.75);
        transform-origin: 50% 50%;
        opacity: 0.3;
        animation: antSpinMove 1s infinite linear alternate;
      }
      .dot i:nth-child(1) {
        top: 0;
        left: 0;
      }
      .dot i:nth-child(2) {
        top: 0;
        right: 0;
        -webkit-animation-delay: 0.4s;
        animation-delay: 0.4s;
      }
      .dot i:nth-child(3) {
        right: 0;
        bottom: 0;
        -webkit-animation-delay: 0.8s;
        animation-delay: 0.8s;
      }
      .dot i:nth-child(4) {
        bottom: 0;
        left: 0;
        -webkit-animation-delay: 1.2s;
        animation-delay: 1.2s;
      }
      @keyframes antRotate {
        to {
          -webkit-transform: rotate(405deg);
          transform: rotate(405deg);
        }
      }
      @-webkit-keyframes antRotate {
        to {
          -webkit-transform: rotate(405deg);
          transform: rotate(405deg);
        }
      }
      @keyframes antSpinMove {
        to {
          opacity: 1;
        }
      }
      @-webkit-keyframes antSpinMove {
        to {
          opacity: 1;
        }
      }
    </style>
    <!-- require cdn assets css -->
    <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
    <link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
    <% } %>
  </head>
  <body>
    <noscript>
      <strong
        >We're sorry but itvita-admin doesn't work properly without JavaScript enabled. Please enable it to
        continue.</strong
      >
    </noscript>
    <div id="app">
      <div class="first-loading-wrp">
        <!-- <h1>Pro</h1> -->
        <h3>基础管理框架</h3>
        <div class="loading-wrp">
          <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
        </div>
        <div style="display: flex; justify-content: center; align-items: center;">资源装载中，请稍等。。。</div>
      </div>
    </div>
    <script type="text/javascript" src="<%= BASE_URL %>main.js"></script>
    <!-- require cdn assets js -->
    <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
    <script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
    <% } %>
    <!-- built files will be auto injected -->
    <script>
      if (window.location.href.indexOf('/login') < 0 && localStorage.getItem('leaveTime') != null) {
        // 记录当前时间并转成时间戳
        const now = new Date().getTime()
        // 从缓存中获取用户上次退出的时间戳
        const leaveTime = parseInt(localStorage.getItem('leaveTime'), 10)
        // 判断是否为刷新，两次间隔在10s内判定为刷新操作
        const refresh = now - leaveTime <= 1000 * 10

        if (!refresh) {
          //重新登陆 清除缓存
          var date = new Date()
          date.setTime(date.getTime() - 10000)
          localStorage.clear()
          location.reload()
        }
      }
      // 退出当前页面执行
      window.onunload = function(e) {
        // ios 不支持 window.onbeforeunload()
        // 将退出时间存于localstorage中
        localStorage.setItem('leaveTime', new Date().getTime())
      }
    </script>
  </body>
</html>
